$(function() {
	
	$(document).on("click", ".selectDescription",function(e){
		e.preventDefault();
		$(".selectRow",$(this).parents("tbody")).removeClass("selectRow");
		$(this).parent().parent().addClass("selectRow");
		var url = $(this).attr("href");
		$("#detailService").load(url, function( data, statusText, response) {
			//console.log(statusText);
			//console.log(response);
			//console.log(response.status);
			var ctx = window.location.pathname;
			if (response.status == "401") {
				window.location.href=ctx+"/errorTimeout.html";
			}
			if (response.status == "500") {
				//window.location.href=ctx+"/error.html";
				$("body").html(response.responseText);
			}
		});
	});
});

function eval2DigitsNumber(variable){
    if (typeof variable === "undefined") {
        return "";
    }
    if(variable == "")
        return variable;
    if(variable.length < 2){
        return "0"+variable
    }
    return variable;
}

function validNumberto24(number){
	if(number>24)
		return false;
	return true;
}
